package labox.innovation.gameserver.pathfinding.cellnodes;

import labox.innovation.gameserver.pathfinding.AbstractNodeLoc;

/**
 *
 * @author -Nemesiss-
 */
public final class NodeLoc extends AbstractNodeLoc {
	
	private final int _x;

	private final int _y;

	public NodeLoc(int x, int y) {
		_x = x;
		_y = y;
	}

	/**
	 * @see labox.innovation.gameserver.pathfinding.AbstractNodeLoc#getX()
	 */
	@Override
	public int getX() {
		return _x << 4;
	}

	/**
	 * @see labox.innovation.gameserver.pathfinding.AbstractNodeLoc#getY()
	 */
	@Override
	public int getY() {
		return _y << 4;
	}

	/**
	 * @see labox.innovation.gameserver.pathfinding.AbstractNodeLoc#getNodeX()
	 */
	@Override
	public int getNodeX() {
		// TODO Auto-generated method stub
		return _x;
	}

	/**
	 * @see labox.innovation.gameserver.pathfinding.AbstractNodeLoc#getNodeY()
	 */
	@Override
	public int getNodeY() {
		// TODO Auto-generated method stub
		return _y;
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + _x;
		result = prime * result + _y;
		return result;
	}

	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		NodeLoc _obj=(NodeLoc)obj;
		if (_x != _obj._x)
			return false;
		if (_y != _obj._y)
			return false;
		return true;
	}

}
